package com.coocaa.ops.common.core.base.model;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author bijiahao
 * @date : 2018/8/15.
 * @description
 *      分页数据封装模型类
 *
 */
@Data
public class PageResultModel<T> implements Serializable {
    private int total;
    private List<T> resultList;

    public PageResultModel() {
    }

    public PageResultModel(int total, List<T> resultList) {
        this.total = total;
        this.resultList = resultList;
    }

    public static <T> PageResultModel<T> getPageResultModel(int total, List<T> resultList) {
        PageResultModel pageResultModel = new PageResultModel<T>();
        pageResultModel.setTotal(total);
        pageResultModel.setResultList(resultList);
        return pageResultModel;
    }
}
